package com.caochenlei.memento;

public class Client {
    public static void main(String[] args) {
        Originator originator = new Originator();
        Caretaker caretaker = new Caretaker();

        originator.setState(" 状态#1 攻击力 300 ");
        caretaker.add(originator.createMemento());
        originator.setState(" 状态#2 攻击力 200 ");
        caretaker.add(originator.createMemento());
        originator.setState(" 状态#3 攻击力 100 ");
        caretaker.add(originator.createMemento());

        System.out.println("当前的状态是：" + originator.getState());
        originator.restoreMemento(caretaker.get(0));
        System.out.println("当前的状态是：" + originator.getState());
    }
}
